3.31.58 \(\int (a+b x)^{-n} (c+d x) (e+f x)^{-5+n} \, dx\) [3058]

Optimal. Leaf size=300 \[ -\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-4+n}}{f (b e-a f) (4-n)}+\frac {(b (3 c f+d e (1-n))-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f)^2 (3-n) (4-n)}+\frac {2 b (b (3 c f+d e (1-n))-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^3 (2-n) (3-n) (4-n)}+\frac {2 b^2 (b (3 c f+d e (1-n))-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-1+n}}{f (b e-a f)^4 (1-n) (2-n) (3-n) (4-n)} \]

[Out]

-(-c*f+d*e)*(b*x+a)^(1-n)*(f*x+e)^(-4+n)/f/(-a*f+b*e)/(4-n)+(b*(3*c*f+d*e*(1-n))-a*d*f*(4-n))*(b*x+a)^(1-n)*(f
*x+e)^(-3+n)/f/(-a*f+b*e)^2/(3-n)/(4-n)+2*b*(b*(3*c*f+d*e*(1-n))-a*d*f*(4-n))*(b*x+a)^(1-n)*(f*x+e)^(-2+n)/f/(
-a*f+b*e)^3/(2-n)/(3-n)/(4-n)+2*b^2*(b*(3*c*f+d*e*(1-n))-a*d*f*(4-n))*(b*x+a)^(1-n)*(f*x+e)^(-1+n)/f/(-a*f+b*e
)^4/(1-n)/(2-n)/(3-n)/(4-n)

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 297, normalized size of antiderivative = 0.99, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {80, 47, 37} \begin {gather*} \frac {2 b^2 (a+b x)^{1-n} (e+f x)^{n-1} (-a d f (4-n)+3 b c f+b d e (1-n))}{f (1-n) (2-n) (3-n) (4-n) (b e-a f)^4}-\frac {(a+b x)^{1-n} (d e-c f) (e+f x)^{n-4}}{f (4-n) (b e-a f)}+\frac {(a+b x)^{1-n} (e+f x)^{n-3} (-a d f (4-n)+3 b c f+b d e (1-n))}{f (3-n) (4-n) (b e-a f)^2}+\frac {2 b (a+b x)^{1-n} (e+f x)^{n-2} (-a d f (4-n)+3 b c f+b d e (1-n))}{f (2-n) (3-n) (4-n) (b e-a f)^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((c + d*x)*(e + f*x)^(-5 + n))/(a + b*x)^n,x]

[Out]

-(((d*e - c*f)*(a + b*x)^(1 - n)*(e + f*x)^(-4 + n))/(f*(b*e - a*f)*(4 - n))) + ((3*b*c*f + b*d*e*(1 - n) - a*
d*f*(4 - n))*(a + b*x)^(1 - n)*(e + f*x)^(-3 + n))/(f*(b*e - a*f)^2*(3 - n)*(4 - n)) + (2*b*(3*b*c*f + b*d*e*(
1 - n) - a*d*f*(4 - n))*(a + b*x)^(1 - n)*(e + f*x)^(-2 + n))/(f*(b*e - a*f)^3*(2 - n)*(3 - n)*(4 - n)) + (2*b
^2*(3*b*c*f + b*d*e*(1 - n) - a*d*f*(4 - n))*(a + b*x)^(1 - n)*(e + f*x)^(-1 + n))/(f*(b*e - a*f)^4*(1 - n)*(2
 - n)*(3 - n)*(4 - n))

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n +
1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rule 47

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n + 1
)/((b*c - a*d)*(m + 1))), x] - Dist[d*(Simplify[m + n + 2]/((b*c - a*d)*(m + 1))), Int[(a + b*x)^Simplify[m +
1]*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && ILtQ[Simplify[m + n + 2], 0] &&
 NeQ[m, -1] &&  !(LtQ[m, -1] && LtQ[n, -1] && (EqQ[a, 0] || (NeQ[c, 0] && LtQ[m - n, 0] && IntegerQ[n]))) && (
SumSimplerQ[m, 1] ||  !SumSimplerQ[n, 1])

Rule 80

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^Simplify[p + 1], x], x] /; FreeQ[{a, b, c
, d, e, f, n, p}, x] &&  !RationalQ[p] && SumSimplerQ[p, 1]

Rubi steps

\begin {align*} \int (a+b x)^{-n} (c+d x) (e+f x)^{-5+n} \, dx &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-4+n}}{f (b e-a f) (4-n)}-\frac {(-3 b c f-d (b e (1-n)+a f (-4+n))) \int (a+b x)^{-n} (e+f x)^{-4+n} \, dx}{f (-b e+a f) (-4+n)}\\ &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-4+n}}{f (b e-a f) (4-n)}+\frac {(3 b c f+b d e (1-n)-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f)^2 (3-n) (4-n)}-\frac {(2 b (-3 b c f-d (b e (1-n)+a f (-4+n)))) \int (a+b x)^{-n} (e+f x)^{-3+n} \, dx}{f (b e-a f) (-b e+a f) (3-n) (-4+n)}\\ &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-4+n}}{f (b e-a f) (4-n)}+\frac {(3 b c f+b d e (1-n)-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f)^2 (3-n) (4-n)}+\frac {2 b (3 b c f+b d e (1-n)-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^3 (2-n) (3-n) (4-n)}-\frac {\left (2 b^2 (-3 b c f-d (b e (1-n)+a f (-4+n)))\right ) \int (a+b x)^{-n} (e+f x)^{-2+n} \, dx}{f (b e-a f)^2 (-b e+a f) (2-n) (3-n) (-4+n)}\\ &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-4+n}}{f (b e-a f) (4-n)}+\frac {(3 b c f+b d e (1-n)-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f)^2 (3-n) (4-n)}+\frac {2 b (3 b c f+b d e (1-n)-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^3 (2-n) (3-n) (4-n)}+\frac {2 b^2 (3 b c f+b d e (1-n)-a d f (4-n)) (a+b x)^{1-n} (e+f x)^{-1+n}}{f (b e-a f)^4 (1-n) (2-n) (3-n) (4-n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.37, size = 145, normalized size = 0.48 \begin {gather*} \frac {(a+b x)^{1-n} (e+f x)^{-4+n} \left (-d e+c f-\frac {(3 b c f+a d f (-4+n)-b d e (-1+n)) (e+f x) \left ((b e-a f)^2 (-2+n) (-1+n)-2 b (e+f x) (b e (-2+n)-a f (-1+n)-b f x)\right )}{(b e-a f)^3 (-3+n) (-2+n) (-1+n)}\right )}{f (-b e+a f) (-4+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((c + d*x)*(e + f*x)^(-5 + n))/(a + b*x)^n,x]

[Out]

((a + b*x)^(1 - n)*(e + f*x)^(-4 + n)*(-(d*e) + c*f - ((3*b*c*f + a*d*f*(-4 + n) - b*d*e*(-1 + n))*(e + f*x)*(
(b*e - a*f)^2*(-2 + n)*(-1 + n) - 2*b*(e + f*x)*(b*e*(-2 + n) - a*f*(-1 + n) - b*f*x)))/((b*e - a*f)^3*(-3 + n
)*(-2 + n)*(-1 + n))))/(f*(-(b*e) + a*f)*(-4 + n))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1187\) vs. \(2(300)=600\).
time = 0.10, size = 1188, normalized size = 3.96

method result size
gosper \(\frac {\left (b x +a \right ) \left (f x +e \right )^{-4+n} \left (a^{3} d \,f^{3} n^{3} x -3 a^{2} b d e \,f^{2} n^{3} x +2 a^{2} b d \,f^{3} n^{2} x^{2}+3 a \,b^{2} d \,e^{2} f \,n^{3} x -4 a \,b^{2} d e \,f^{2} n^{2} x^{2}+2 a \,b^{2} d \,f^{3} n \,x^{3}-b^{3} d \,e^{3} n^{3} x +2 b^{3} d \,e^{2} f \,n^{2} x^{2}-2 b^{3} d e \,f^{2} n \,x^{3}+a^{3} c \,f^{3} n^{3}-7 a^{3} d \,f^{3} n^{2} x -3 a^{2} b c e \,f^{2} n^{3}+3 a^{2} b c \,f^{3} n^{2} x +22 a^{2} b d e \,f^{2} n^{2} x -10 a^{2} b d \,f^{3} n \,x^{2}+3 a \,b^{2} c \,e^{2} f \,n^{3}-6 a \,b^{2} c e \,f^{2} n^{2} x +6 a \,b^{2} c \,f^{3} n \,x^{2}-23 a \,b^{2} d \,e^{2} f \,n^{2} x +20 a \,b^{2} d e \,f^{2} n \,x^{2}-8 a \,b^{2} d \,f^{3} x^{3}-b^{3} c \,e^{3} n^{3}+3 b^{3} c \,e^{2} f \,n^{2} x -6 b^{3} c e \,f^{2} n \,x^{2}+6 b^{3} c \,f^{3} x^{3}+8 b^{3} d \,e^{3} n^{2} x -10 b^{3} d \,e^{2} f n \,x^{2}+2 b^{3} d e \,f^{2} x^{3}-6 a^{3} c \,f^{3} n^{2}-a^{3} d e \,f^{2} n^{2}+14 a^{3} d \,f^{3} n x +21 a^{2} b c e \,f^{2} n^{2}-9 a^{2} b c \,f^{3} n x +2 a^{2} b d \,e^{2} f \,n^{2}-53 a^{2} b d e \,f^{2} n x +8 a^{2} b d \,f^{3} x^{2}-24 a \,b^{2} c \,e^{2} f \,n^{2}+30 a \,b^{2} c e \,f^{2} n x -6 a \,b^{2} c \,f^{3} x^{2}-a \,b^{2} d \,e^{3} n^{2}+58 a \,b^{2} d \,e^{2} f n x -34 a \,b^{2} d e \,f^{2} x^{2}+9 b^{3} c \,e^{3} n^{2}-21 b^{3} c \,e^{2} f n x +24 b^{3} c e \,f^{2} x^{2}-19 b^{3} d \,e^{3} n x +8 b^{3} d \,e^{2} f \,x^{2}+11 a^{3} c \,f^{3} n +3 a^{3} d e \,f^{2} n -8 a^{3} d \,f^{3} x -42 a^{2} b c e \,f^{2} n +6 a^{2} b c \,f^{3} x -10 a^{2} b d \,e^{2} f n +34 a^{2} b d e \,f^{2} x +57 a \,b^{2} c \,e^{2} f n -24 a \,b^{2} c e \,f^{2} x +7 a \,b^{2} d \,e^{3} n -56 a \,b^{2} d \,e^{2} f x -26 b^{3} c \,e^{3} n +36 b^{3} c \,e^{2} f x +12 b^{3} d \,e^{3} x -6 a^{3} c \,f^{3}-2 a^{3} d e \,f^{2}+24 a^{2} b c e \,f^{2}+8 a^{2} b d \,e^{2} f -36 a \,b^{2} c \,e^{2} f -12 a \,b^{2} d \,e^{3}+24 b^{3} c \,e^{3}\right ) \left (b x +a \right )^{-n}}{a^{4} f^{4} n^{4}-4 a^{3} b e \,f^{3} n^{4}+6 a^{2} b^{2} e^{2} f^{2} n^{4}-4 a \,b^{3} e^{3} f \,n^{4}+b^{4} e^{4} n^{4}-10 a^{4} f^{4} n^{3}+40 a^{3} b e \,f^{3} n^{3}-60 a^{2} b^{2} e^{2} f^{2} n^{3}+40 a \,b^{3} e^{3} f \,n^{3}-10 b^{4} e^{4} n^{3}+35 a^{4} f^{4} n^{2}-140 a^{3} b e \,f^{3} n^{2}+210 a^{2} b^{2} e^{2} f^{2} n^{2}-140 a \,b^{3} e^{3} f \,n^{2}+35 b^{4} e^{4} n^{2}-50 a^{4} f^{4} n +200 a^{3} b e \,f^{3} n -300 a^{2} b^{2} e^{2} f^{2} n +200 a \,b^{3} e^{3} f n -50 b^{4} e^{4} n +24 a^{4} f^{4}-96 a^{3} b e \,f^{3}+144 a^{2} b^{2} e^{2} f^{2}-96 a \,b^{3} e^{3} f +24 b^{4} e^{4}}\) \(1188\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)*(f*x+e)^(-5+n)/((b*x+a)^n),x,method=_RETURNVERBOSE)

[Out]

(b*x+a)*(f*x+e)^(-4+n)*(a^3*d*f^3*n^3*x-3*a^2*b*d*e*f^2*n^3*x+2*a^2*b*d*f^3*n^2*x^2+3*a*b^2*d*e^2*f*n^3*x-4*a*
b^2*d*e*f^2*n^2*x^2+2*a*b^2*d*f^3*n*x^3-b^3*d*e^3*n^3*x+2*b^3*d*e^2*f*n^2*x^2-2*b^3*d*e*f^2*n*x^3+a^3*c*f^3*n^
3-7*a^3*d*f^3*n^2*x-3*a^2*b*c*e*f^2*n^3+3*a^2*b*c*f^3*n^2*x+22*a^2*b*d*e*f^2*n^2*x-10*a^2*b*d*f^3*n*x^2+3*a*b^
2*c*e^2*f*n^3-6*a*b^2*c*e*f^2*n^2*x+6*a*b^2*c*f^3*n*x^2-23*a*b^2*d*e^2*f*n^2*x+20*a*b^2*d*e*f^2*n*x^2-8*a*b^2*
d*f^3*x^3-b^3*c*e^3*n^3+3*b^3*c*e^2*f*n^2*x-6*b^3*c*e*f^2*n*x^2+6*b^3*c*f^3*x^3+8*b^3*d*e^3*n^2*x-10*b^3*d*e^2
*f*n*x^2+2*b^3*d*e*f^2*x^3-6*a^3*c*f^3*n^2-a^3*d*e*f^2*n^2+14*a^3*d*f^3*n*x+21*a^2*b*c*e*f^2*n^2-9*a^2*b*c*f^3
*n*x+2*a^2*b*d*e^2*f*n^2-53*a^2*b*d*e*f^2*n*x+8*a^2*b*d*f^3*x^2-24*a*b^2*c*e^2*f*n^2+30*a*b^2*c*e*f^2*n*x-6*a*
b^2*c*f^3*x^2-a*b^2*d*e^3*n^2+58*a*b^2*d*e^2*f*n*x-34*a*b^2*d*e*f^2*x^2+9*b^3*c*e^3*n^2-21*b^3*c*e^2*f*n*x+24*
b^3*c*e*f^2*x^2-19*b^3*d*e^3*n*x+8*b^3*d*e^2*f*x^2+11*a^3*c*f^3*n+3*a^3*d*e*f^2*n-8*a^3*d*f^3*x-42*a^2*b*c*e*f
^2*n+6*a^2*b*c*f^3*x-10*a^2*b*d*e^2*f*n+34*a^2*b*d*e*f^2*x+57*a*b^2*c*e^2*f*n-24*a*b^2*c*e*f^2*x+7*a*b^2*d*e^3
*n-56*a*b^2*d*e^2*f*x-26*b^3*c*e^3*n+36*b^3*c*e^2*f*x+12*b^3*d*e^3*x-6*a^3*c*f^3-2*a^3*d*e*f^2+24*a^2*b*c*e*f^
2+8*a^2*b*d*e^2*f-36*a*b^2*c*e^2*f-12*a*b^2*d*e^3+24*b^3*c*e^3)/(a^4*f^4*n^4-4*a^3*b*e*f^3*n^4+6*a^2*b^2*e^2*f
^2*n^4-4*a*b^3*e^3*f*n^4+b^4*e^4*n^4-10*a^4*f^4*n^3+40*a^3*b*e*f^3*n^3-60*a^2*b^2*e^2*f^2*n^3+40*a*b^3*e^3*f*n
^3-10*b^4*e^4*n^3+35*a^4*f^4*n^2-140*a^3*b*e*f^3*n^2+210*a^2*b^2*e^2*f^2*n^2-140*a*b^3*e^3*f*n^2+35*b^4*e^4*n^
2-50*a^4*f^4*n+200*a^3*b*e*f^3*n-300*a^2*b^2*e^2*f^2*n+200*a*b^3*e^3*f*n-50*b^4*e^4*n+24*a^4*f^4-96*a^3*b*e*f^
3+144*a^2*b^2*e^2*f^2-96*a*b^3*e^3*f+24*b^4*e^4)/((b*x+a)^n)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(f*x+e)^(-5+n)/((b*x+a)^n),x, algorithm="maxima")

[Out]

integrate((d*x + c)*(f*x + e)^(n - 5)/(b*x + a)^n, x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1727 vs. \(2 (279) = 558\).
time = 1.66, size = 1727, normalized size = 5.76 \begin {gather*} \frac {{\left (2 \, {\left (a b^{3} d f^{4} n + {\left (3 \, b^{4} c - 4 \, a b^{3} d\right )} f^{4}\right )} x^{5} + 2 \, {\left (a^{2} b^{2} d f^{4} n^{2} + {\left (3 \, a b^{3} c - 4 \, a^{2} b^{2} d\right )} f^{4} n\right )} x^{4} + {\left (a^{3} b d f^{4} n^{3} + {\left (3 \, a^{2} b^{2} c - 5 \, a^{3} b d\right )} f^{4} n^{2} - {\left (3 \, a^{2} b^{2} c - 4 \, a^{3} b d\right )} f^{4} n\right )} x^{3} - {\left (8 \, a^{4} d f^{4} - {\left (a^{3} b c + a^{4} d\right )} f^{4} n^{3} + {\left (3 \, a^{3} b c + 7 \, a^{4} d\right )} f^{4} n^{2} - 2 \, {\left (a^{3} b c + 7 \, a^{4} d\right )} f^{4} n\right )} x^{2} + {\left (a^{4} c f^{4} n^{3} - 6 \, a^{4} c f^{4} n^{2} + 11 \, a^{4} c f^{4} n - 6 \, a^{4} c f^{4}\right )} x - {\left (a b^{3} c n^{3} - 24 \, a b^{3} c + 12 \, a^{2} b^{2} d - {\left (9 \, a b^{3} c - a^{2} b^{2} d\right )} n^{2} + {\left (b^{4} d n^{3} - 8 \, b^{4} d n^{2} + 19 \, b^{4} d n - 12 \, b^{4} d\right )} x^{2} + {\left (26 \, a b^{3} c - 7 \, a^{2} b^{2} d\right )} n - {\left (24 \, b^{4} c - {\left (b^{4} c + a b^{3} d\right )} n^{3} + {\left (9 \, b^{4} c + 7 \, a b^{3} d\right )} n^{2} - 2 \, {\left (13 \, b^{4} c + 6 \, a b^{3} d\right )} n\right )} x\right )} e^{4} + {\left (3 \, a^{2} b^{2} c f n^{3} - 2 \, {\left (12 \, a^{2} b^{2} c - a^{3} b d\right )} f n^{2} - {\left (b^{4} d f n^{3} - 10 \, b^{4} d f n^{2} + 29 \, b^{4} d f n - 20 \, b^{4} d f\right )} x^{3} + {\left (57 \, a^{2} b^{2} c - 10 \, a^{3} b d\right )} f n - {\left ({\left (b^{4} c - 2 \, a b^{3} d\right )} f n^{3} - 2 \, {\left (6 \, b^{4} c - 7 \, a b^{3} d\right )} f n^{2} + {\left (47 \, b^{4} c - 36 \, a b^{3} d\right )} f n - 12 \, {\left (5 \, b^{4} c - 4 \, a b^{3} d\right )} f\right )} x^{2} - 4 \, {\left (9 \, a^{2} b^{2} c - 2 \, a^{3} b d\right )} f + {\left ({\left (2 \, a b^{3} c + 3 \, a^{2} b^{2} d\right )} f n^{3} - 2 \, {\left (6 \, a b^{3} c + 11 \, a^{2} b^{2} d\right )} f n^{2} + 5 \, {\left (2 \, a b^{3} c + 11 \, a^{2} b^{2} d\right )} f n + 12 \, {\left (2 \, a b^{3} c - 5 \, a^{2} b^{2} d\right )} f\right )} x\right )} e^{3} - {\left (3 \, a^{3} b c f^{2} n^{3} - {\left (21 \, a^{3} b c - a^{4} d\right )} f^{2} n^{2} - 2 \, {\left (b^{4} d f^{2} n^{2} - 6 \, b^{4} d f^{2} n + 5 \, b^{4} d f^{2}\right )} x^{4} + 3 \, {\left (14 \, a^{3} b c - a^{4} d\right )} f^{2} n - {\left (3 \, a b^{3} d f^{2} n^{3} + {\left (3 \, b^{4} c - 25 \, a b^{3} d\right )} f^{2} n^{2} - 3 \, {\left (9 \, b^{4} c - 22 \, a b^{3} d\right )} f^{2} n + 20 \, {\left (3 \, b^{4} c - 4 \, a b^{3} d\right )} f^{2}\right )} x^{3} - 2 \, {\left (12 \, a^{3} b c - a^{4} d\right )} f^{2} - 3 \, {\left (a b^{3} c f^{2} n^{3} - 16 \, a^{2} b^{2} d f^{2} - {\left (9 \, a b^{3} c + a^{2} b^{2} d\right )} f^{2} n^{2} + 5 \, {\left (4 \, a b^{3} c + a^{2} b^{2} d\right )} f^{2} n\right )} x^{2} + {\left (3 \, a^{3} b d f^{2} n^{3} + {\left (9 \, a^{2} b^{2} c - 23 \, a^{3} b d\right )} f^{2} n^{2} - 15 \, {\left (3 \, a^{2} b^{2} c - 4 \, a^{3} b d\right )} f^{2} n + 4 \, {\left (9 \, a^{2} b^{2} c - 10 \, a^{3} b d\right )} f^{2}\right )} x\right )} e^{2} + {\left (a^{4} c f^{3} n^{3} - 6 \, a^{4} c f^{3} n^{2} + 11 \, a^{4} c f^{3} n - 6 \, a^{4} c f^{3} - 2 \, {\left (b^{4} d f^{3} n - b^{4} d f^{3}\right )} x^{5} - 2 \, {\left (2 \, a b^{3} d f^{3} n^{2} + {\left (3 \, b^{4} c - 10 \, a b^{3} d\right )} f^{3} n - 5 \, {\left (3 \, b^{4} c - 4 \, a b^{3} d\right )} f^{3}\right )} x^{4} - {\left (3 \, a^{2} b^{2} d f^{3} n^{3} + 2 \, {\left (3 \, a b^{3} c - 10 \, a^{2} b^{2} d\right )} f^{3} n^{2} - {\left (30 \, a b^{3} c - 41 \, a^{2} b^{2} d\right )} f^{3} n\right )} x^{3} + {\left (32 \, a^{3} b d f^{3} - {\left (3 \, a^{2} b^{2} c + 2 \, a^{3} b d\right )} f^{3} n^{3} + 2 \, {\left (9 \, a^{2} b^{2} c + 8 \, a^{3} b d\right )} f^{3} n^{2} - {\left (15 \, a^{2} b^{2} c + 46 \, a^{3} b d\right )} f^{3} n\right )} x^{2} - {\left ({\left (2 \, a^{3} b c - a^{4} d\right )} f^{3} n^{3} - 2 \, {\left (9 \, a^{3} b c - 4 \, a^{4} d\right )} f^{3} n^{2} + {\left (40 \, a^{3} b c - 17 \, a^{4} d\right )} f^{3} n - 2 \, {\left (12 \, a^{3} b c - 5 \, a^{4} d\right )} f^{3}\right )} x\right )} e\right )} {\left (f x + e\right )}^{n - 5}}{{\left (a^{4} f^{4} n^{4} - 10 \, a^{4} f^{4} n^{3} + 35 \, a^{4} f^{4} n^{2} - 50 \, a^{4} f^{4} n + 24 \, a^{4} f^{4} + {\left (b^{4} n^{4} - 10 \, b^{4} n^{3} + 35 \, b^{4} n^{2} - 50 \, b^{4} n + 24 \, b^{4}\right )} e^{4} - 4 \, {\left (a b^{3} f n^{4} - 10 \, a b^{3} f n^{3} + 35 \, a b^{3} f n^{2} - 50 \, a b^{3} f n + 24 \, a b^{3} f\right )} e^{3} + 6 \, {\left (a^{2} b^{2} f^{2} n^{4} - 10 \, a^{2} b^{2} f^{2} n^{3} + 35 \, a^{2} b^{2} f^{2} n^{2} - 50 \, a^{2} b^{2} f^{2} n + 24 \, a^{2} b^{2} f^{2}\right )} e^{2} - 4 \, {\left (a^{3} b f^{3} n^{4} - 10 \, a^{3} b f^{3} n^{3} + 35 \, a^{3} b f^{3} n^{2} - 50 \, a^{3} b f^{3} n + 24 \, a^{3} b f^{3}\right )} e\right )} {\left (b x + a\right )}^{n}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(f*x+e)^(-5+n)/((b*x+a)^n),x, algorithm="fricas")

[Out]

(2*(a*b^3*d*f^4*n + (3*b^4*c - 4*a*b^3*d)*f^4)*x^5 + 2*(a^2*b^2*d*f^4*n^2 + (3*a*b^3*c - 4*a^2*b^2*d)*f^4*n)*x
^4 + (a^3*b*d*f^4*n^3 + (3*a^2*b^2*c - 5*a^3*b*d)*f^4*n^2 - (3*a^2*b^2*c - 4*a^3*b*d)*f^4*n)*x^3 - (8*a^4*d*f^
4 - (a^3*b*c + a^4*d)*f^4*n^3 + (3*a^3*b*c + 7*a^4*d)*f^4*n^2 - 2*(a^3*b*c + 7*a^4*d)*f^4*n)*x^2 + (a^4*c*f^4*
n^3 - 6*a^4*c*f^4*n^2 + 11*a^4*c*f^4*n - 6*a^4*c*f^4)*x - (a*b^3*c*n^3 - 24*a*b^3*c + 12*a^2*b^2*d - (9*a*b^3*
c - a^2*b^2*d)*n^2 + (b^4*d*n^3 - 8*b^4*d*n^2 + 19*b^4*d*n - 12*b^4*d)*x^2 + (26*a*b^3*c - 7*a^2*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)*f^2)*x)*e^2 + (
a^4*c*f^3*n^3 - 6*a^4*c*f^3*n^2 + 11*a^4*c*f^3*n - 6*a^4*c*f^3 - 2*(b^4*d*f^3*n - b^4*d*f^3)*x^5 - 2*(2*a*b^3*
d*f^3*n^2 + (3*b^4*c - 10*a*b^3*d)*f^3*n - 5*(3*b^4*c - 4*a*b^3*d)*f^3)*x^4 - (3*a^2*b^2*d*f^3*n^3 + 2*(3*a*b^
3*c - 10*a^2*b^2*d)*f^3*n^2 - (30*a*b^3*c - 41*a^2*b^2*d)*f^3*n)*x^3 + (32*a^3*b*d*f^3 - (3*a^2*b^2*c + 2*a^3*
b*d)*f^3*n^3 + 2*(9*a^2*b^2*c + 8*a^3*b*d)*f^3*n^2 - (15*a^2*b^2*c + 46*a^3*b*d)*f^3*n)*x^2 - ((2*a^3*b*c - a^
4*d)*f^3*n^3 - 2*(9*a^3*b*c - 4*a^4*d)*f^3*n^2 + (40*a^3*b*c - 17*a^4*d)*f^3*n - 2*(12*a^3*b*c - 5*a^4*d)*f^3)
*x)*e)*(f*x + e)^(n - 5)/((a^4*f^4*n^4 - 10*a^4*f^4*n^3 + 35*a^4*f^4*n^2 - 50*a^4*f^4*n + 24*a^4*f^4 + (b^4*n^
4 - 10*b^4*n^3 + 35*b^4*n^2 - 50*b^4*n + 24*b^4)*e^4 - 4*(a*b^3*f*n^4 - 10*a*b^3*f*n^3 + 35*a*b^3*f*n^2 - 50*a
*b^3*f*n + 24*a*b^3*f)*e^3 + 6*(a^2*b^2*f^2*n^4 - 10*a^2*b^2*f^2*n^3 + 35*a^2*b^2*f^2*n^2 - 50*a^2*b^2*f^2*n +
 24*a^2*b^2*f^2)*e^2 - 4*(a^3*b*f^3*n^4 - 10*a^3*b*f^3*n^3 + 35*a^3*b*f^3*n^2 - 50*a^3*b*f^3*n + 24*a^3*b*f^3)
*e)*(b*x + a)^n)

________________________________________________________________________________________

Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(f*x+e)**(-5+n)/((b*x+a)**n),x)

[Out]

Exception raised: SystemError >> excessive stack use: stack is 6191 deep

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(f*x+e)^(-5+n)/((b*x+a)^n),x, algorithm="giac")

[Out]

integrate((d*x + c)*(f*x + e)^(n - 5)/(b*x + a)^n, x)

________________________________________________________________________________________

Mupad [B]
time = 4.56, size = 1659, normalized size = 5.53 \begin {gather*} \frac {2\,b^3\,f^3\,x^5\,{\left (e+f\,x\right )}^{n-5}\,\left (3\,b\,c\,f-4\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )}{{\left (a\,f-b\,e\right )}^4\,{\left (a+b\,x\right )}^n\,\left (n^4-10\,n^3+35\,n^2-50\,n+24\right )}-\frac {x\,{\left (e+f\,x\right )}^{n-5}\,\left (-d\,a^4\,e\,f^3\,n^3+8\,d\,a^4\,e\,f^3\,n^2-17\,d\,a^4\,e\,f^3\,n+10\,d\,a^4\,e\,f^3-c\,a^4\,f^4\,n^3+6\,c\,a^4\,f^4\,n^2-11\,c\,a^4\,f^4\,n+6\,c\,a^4\,f^4+3\,d\,a^3\,b\,e^2\,f^2\,n^3-23\,d\,a^3\,b\,e^2\,f^2\,n^2+60\,d\,a^3\,b\,e^2\,f^2\,n-40\,d\,a^3\,b\,e^2\,f^2+2\,c\,a^3\,b\,e\,f^3\,n^3-18\,c\,a^3\,b\,e\,f^3\,n^2+40\,c\,a^3\,b\,e\,f^3\,n-24\,c\,a^3\,b\,e\,f^3-3\,d\,a^2\,b^2\,e^3\,f\,n^3+22\,d\,a^2\,b^2\,e^3\,f\,n^2-55\,d\,a^2\,b^2\,e^3\,f\,n+60\,d\,a^2\,b^2\,e^3\,f+9\,c\,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\,n^2+19\,d\,b^4\,e^4\,n-12\,d\,b^4\,e^4+c\,b^4\,e^3\,f\,n^3-12\,c\,b^4\,e^3\,f\,n^2+47\,c\,b^4\,e^3\,f\,n-60\,c\,b^4\,e^3\,f\right )}{{\left (a\,f-b\,e\right )}^4\,{\left (a+b\,x\right )}^n\,\left (n^4-10\,n^3+35\,n^2-50\,n+24\right )}-\frac {{\left (e+f\,x\right )}^{n-5}\,\left (d\,a^4\,e^2\,f^2\,n^2-3\,d\,a^4\,e^2\,f^2\,n+2\,d\,a^4\,e^2\,f^2-c\,a^4\,e\,f^3\,n^3+6\,c\,a^4\,e\,f^3\,n^2-11\,c\,a^4\,e\,f^3\,n+6\,c\,a^4\,e\,f^3-2\,d\,a^3\,b\,e^3\,f\,n^2+10\,d\,a^3\,b\,e^3\,f\,n-8\,d\,a^3\,b\,e^3\,f+3\,c\,a^3\,b\,e^2\,f^2\,n^3-21\,c\,a^3\,b\,e^2\,f^2\,n^2+42\,c\,a^3\,b\,e^2\,f^2\,n-24\,c\,a^3\,b\,e^2\,f^2+d\,a^2\,b^2\,e^4\,n^2-7\,d\,a^2\,b^2\,e^4\,n+12\,d\,a^2\,b^2\,e^4-3\,c\,a^2\,b^2\,e^3\,f\,n^3+24\,c\,a^2\,b^2\,e^3\,f\,n^2-57\,c\,a^2\,b^2\,e^3\,f\,n+36\,c\,a^2\,b^2\,e^3\,f+c\,a\,b^3\,e^4\,n^3-9\,c\,a\,b^3\,e^4\,n^2+26\,c\,a\,b^3\,e^4\,n-24\,c\,a\,b^3\,e^4\right )}{{\left (a\,f-b\,e\right )}^4\,{\left (a+b\,x\right )}^n\,\left (n^4-10\,n^3+35\,n^2-50\,n+24\right )}+\frac {b\,f\,x^3\,{\left (e+f\,x\right )}^{n-5}\,\left (3\,b\,c\,f-4\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )\,\left (a^2\,f^2\,n^2-a^2\,f^2\,n-2\,a\,b\,e\,f\,n^2+10\,a\,b\,e\,f\,n+b^2\,e^2\,n^2-9\,b^2\,e^2\,n+20\,b^2\,e^2\right )}{{\left (a\,f-b\,e\right )}^4\,{\left (a+b\,x\right )}^n\,\left (n^4-10\,n^3+35\,n^2-50\,n+24\right )}+\frac {2\,b^2\,f^2\,x^4\,{\left (e+f\,x\right )}^{n-5}\,\left (5\,b\,e+a\,f\,n-b\,e\,n\right )\,\left (3\,b\,c\,f-4\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )}{{\left (a\,f-b\,e\right )}^4\,{\left (a+b\,x\right )}^n\,\left (n^4-10\,n^3+35\,n^2-50\,n+24\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((e + f*x)^(n - 5)*(c + d*x))/(a + b*x)^n,x)

[Out]

(2*b^3*f^3*x^5*(e + f*x)^(n - 5)*(3*b*c*f - 4*a*d*f + b*d*e + a*d*f*n - b*d*e*n))/((a*f - b*e)^4*(a + b*x)^n*(
35*n^2 - 50*n - 10*n^3 + n^4 + 24)) - (x*(e + f*x)^(n - 5)*(6*a^4*c*f^4 - 24*b^4*c*e^4 + 6*a^4*c*f^4*n^2 - 9*b
^4*c*e^4*n^2 - a^4*c*f^4*n^3 + b^4*c*e^4*n^3 + 10*a^4*d*e*f^3 - 11*a^4*c*f^4*n + 26*b^4*c*e^4*n - 24*a*b^3*c*e
^3*f - 24*a^3*b*c*e*f^3 + 12*a*b^3*d*e^4*n - 17*a^4*d*e*f^3*n + 60*a^2*b^2*d*e^3*f - 40*a^3*b*d*e^2*f^2 - 7*a*
b^3*d*e^4*n^2 + a*b^3*d*e^4*n^3 + 8*a^4*d*e*f^3*n^2 - a^4*d*e*f^3*n^3 + 36*a^2*b^2*c*e^2*f^2 - 45*a^2*b^2*c*e^
2*f^2*n + 22*a^2*b^2*d*e^3*f*n^2 - 23*a^3*b*d*e^2*f^2*n^2 - 3*a^2*b^2*d*e^3*f*n^3 + 3*a^3*b*d*e^2*f^2*n^3 - 10
*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3 - 8*
a^3*b*d*e^3*f + 26*a*b^3*c*e^4*n - 11*a^4*c*e*f^3*n + 36*a^2*b^2*c*e^3*f - 24*a^3*b*c*e^2*f^2 - 9*a*b^3*c*e^4*
n^2 + a*b^3*c*e^4*n^3 - 7*a^2*b^2*d*e^4*n + 6*a^4*c*e*f^3*n^2 - a^4*c*e*f^3*n^3 - 3*a^4*d*e^2*f^2*n + a^2*b^2*
d*e^4*n^2 + a^4*d*e^2*f^2*n^2 + 24*a^2*b^2*c*e^3*f*n^2 - 21*a^3*b*c*e^2*f^2*n^2 - 3*a^2*b^2*c*e^3*f*n^3 + 3*a^
3*b*c*e^2*f^2*n^3 + 10*a^3*b*d*e^3*f*n - 57*a^2*b^2*c*e^3*f*n + 42*a^3*b*c*e^2*f^2*n - 2*a^3*b*d*e^3*f*n^2))/(
(a*f - b*e)^4*(a + b*x)^n*(35*n^2 - 50*n - 10*n^3 + n^4 + 24)) + (b*f*x^3*(e + f*x)^(n - 5)*(3*b*c*f - 4*a*d*f
 + b*d*e + a*d*f*n - b*d*e*n)*(20*b^2*e^2 - a^2*f^2*n - 9*b^2*e^2*n + a^2*f^2*n^2 + b^2*e^2*n^2 + 10*a*b*e*f*n
 - 2*a*b*e*f*n^2))/((a*f - b*e)^4*(a + b*x)^n*(35*n^2 - 50*n - 10*n^3 + n^4 + 24)) + (2*b^2*f^2*x^4*(e + f*x)^
(n - 5)*(5*b*e + a*f*n - b*e*n)*(3*b*c*f - 4*a*d*f + b*d*e + a*d*f*n - b*d*e*n))/((a*f - b*e)^4*(a + b*x)^n*(3
5*n^2 - 50*n - 10*n^3 + n^4 + 24))

________________________________________________________________________________________